package com.Arsanesia.TempleRush;

import com.Arsanesia.TempleRush.Controllers.ProfileManager;
import com.Arsanesia.TempleRush.Helpers.ActionResolver;
import com.Arsanesia.TempleRush.Views.Screens.*;
import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Screen;
import com.flurry.android.FlurryAgent;

public class TempleRush extends Game{
	public static final String LOG = TempleRush.class.getSimpleName();
	private ProfileManager profilemanager;
	private ActionResolver actionresolver;
	
	public TempleRush (ActionResolver ar){
		super();
		this.actionresolver = ar;
	}
	
	public void resolveUri(String uri){
		actionresolver.openUri(uri);
	}
	
	public SplashScreen getSplashScreen(){
		FlurryAgent.logEvent("Showing Splash Screen",true);
		return new SplashScreen(this);
	}
	public StoryScreen getStoryScreen(){
		FlurryAgent.logEvent("Showing Story Screen",true);
		return new StoryScreen(this);
	}
	public MenuScreen getMenuScreen(){
		FlurryAgent.logEvent("Showing Menu Screen",true);
		return new MenuScreen(this);
	}
	public GameScreen getGameScreen(){
		FlurryAgent.logEvent("Showing Game Screen",true);
		return new GameScreen(this);
	}
	public HelpScreen getHelpScreen(){
		FlurryAgent.logEvent("Showing Help Screen",true);
		return new HelpScreen(this);
	}
	public AboutScreen getAboutScreen(){
		FlurryAgent.logEvent("Showing About Screen",true);
		return new AboutScreen(this);
	}
	public HighScoreScreen getHighScoreScreen(){
		FlurryAgent.logEvent("Showing HighScore Screen",true);
		return new HighScoreScreen(this);
	}
	public GameOverScreen getGameOverScreen(){
		FlurryAgent.logEvent("Showing Game Over Screen",true);
		return new GameOverScreen(this);
	}
	public AchievementScreen getAchievementScreen(){
		FlurryAgent.logEvent("Showing Achievement Screen",true);
		return new AchievementScreen(this);
	}
	public PreferenceScreen getPreferenceScreen(){
		FlurryAgent.logEvent("Showing Preference Screen",true);
		return new PreferenceScreen(this);
	}
	public ProfileManager getProfileManager() {
		return profilemanager;
	}
	@Override
	public void create() {
		profilemanager = new ProfileManager();
		profilemanager.retrieveProfile();
		setScreen(getPreferenceScreen());

	}

	@Override
	public void dispose() {
		super.dispose();
	}

	@Override
	public void render() {		
		super.render();		

	}

	@Override
	public void resize(int width, int height) {
		super.resize(width, height);
	}

	@Override
	public void pause() {
		super.pause();
	}

	@Override
	public void resume() {
		super.resume();
	}

	public void setScreen(Screen screen){
		super.setScreen(screen);
	}
	
}
